1. Field of Invention
The present invention relates to a method and apparatus to map associations within a database using BitSets.
2. Description of the Prior Art
In enterprise and other business environments, there is a need to represent associations between two or more entities. The relationships in these associations are classified in terms of degree, connectivity, cardinality, and existence. In a relational database, a data model is used to design the relational tables. A functional model is used to design the queries that will access and perform operations on the relational tables. In the context of the present invention, a relationship is an association between two or more tables. Relationships are expressed in the data values of the primary and foreign keys. A primary key is a column or columns in a table whose values uniquely identify each row in a table. A foreign key is a column or columns whose values are the same as the primary key of another table. A relationship is made between two relational tables by matching the values of the foreign key in one table with the values of the primary key in another.
Currently, in a normalized database, relationships are modeled with the use of foreign keys from two tables, which together form the key for the association table. In this existing approach, multiple rows are required to explicitly store the many sides of relationship. This situation is an unnecessary overhead that results in increased complexity for the user to manage relationships and transactions. As a result, there is no easy way of specifying the relationship multiplicity. Multiplicity indicates how many instances of one class are related to a single instance of another class at a given point in time.
The present invention utilizes a fast BITSET implementation to model multiple foreign-keys within a single column. Presently, there is no product database that currently models relationships through multi-foreignkey columns.